# supply two executives: mbuild and mbuild_ih(inhomogenous pore).
bin_PROGRAMS = mbuild compare dxave dxrave
AM_CXXFLAGS = -I${top_srcdir}/src/include -fopenmp
mbuild_SOURCES = mBuild_inhomogenous.cpp
mbuild_LDADD = ${top_srcdir}/src/essential/libmbuild.a
compare_SOURCES = compare.cpp
compare_LDADD = ${top_srcdir}/src/essential/libmbuild.a
dxave_SOURCES = dxave.cpp
dxave_LDADD = ${top_srcdir}/src/essential/libmbuild.a
dxrave_SOURCES = dxrave.cpp
dxrave_LDADD = ${top_srcdir}/src/essential/libmbuild.a

check : check-am
	@echo "Unpacking testcases ...."
	@echo "================================================="
	@tar -zxvf test.tar.gz | tee .testcases
	@./mbuild <test.inp
	@./dxave phi_Xm.dx
	@./dxrave phi_Xm.dx
	@echo "================================================"
	@echo "Finished running the tests, please check if the dielx_Xm.dx ... is correctly generated."
	@echo "These files can be visualized using VMD"
clean : clean-am
	rm -f *.dx
	rm -f *.dat
	@cat .testcases | while read f;do echo "rm -f $$f";rm -f $$f;done
	
debug: CXXFLAGS+= -DDEBUG -g
debug: CFLAGS+= -DDEBUG -g
debug: check-am
profile: CXXFLAGS+= -pg
profile: check-am
	@echo "Unpacking testcases ...."
	@echo "================================================="
	@tar -zxvf test.tar.gz | tee .testcases
	@./mbuild <test.inp
	@gprof ./mbuild > mbuild.profile
	@./dxave phi_Xm.dx
	@gprof ./dxave > dxave.profile
	@./dxrave phi_Xm.dx
	@gprof ./dxrave > dxrave.profile
	@echo "================================================"
	@echo "Finished running the tests, please check if the dielx_Xm.dx ... is correctly generated."
	@echo "These files can be visualized using VMD"
